package MathDataTest;

public class MathRandomDemo {
    public static void main(String[] args) {
        //使用Math类的Random方法实现【2-100】之间的偶数
        //生成2-100的整数
        int num = (int)(Math.random()*102)-2;
        System.out.println(num);
        if (num/2 ==0) {
            System.out.println("随机数:"+num+"是偶数");
        }else {
            System.out.println("随机数:"+num+"是奇数");

        }    }
}
